using B.S.NewMedical.ErrorCode;
using MediatR;

namespace B.S.NewMedical.Api.Write.Application.Command.Doctor
{
    /// <summary>
    /// 获取待收费项目命令
    /// </summary>
    public class GetPendingChargeItemsCommand : IRequest<ApiResult<PendingChargeDto>>
    {
        /// <summary>
        /// 就诊卡号
        /// </summary>
        public string CardNo { get; set; }
    }

    /// <summary>
    /// 待收费DTO
    /// </summary>
    public class PendingChargeDto
    {
        /// <summary>
        /// 患者信息
        /// </summary>
        public PatientInfoDto Patient { get; set; }

        /// <summary>
        /// 处方列表
        /// </summary>
        public List<PendingPrescriptionDto> Prescriptions { get; set; } = new List<PendingPrescriptionDto>();

        /// <summary>
        /// 检验单列表
        /// </summary>
        public List<PendingLaborderDto> Laborders { get; set; } = new List<PendingLaborderDto>();

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }
    }

    /// <summary>
    /// 患者信息DTO
    /// </summary>
    public class PatientInfoDto
    {
        public int PatientId { get; set; }
        public string PatientName { get; set; }
        public string CardNo { get; set; }
        public decimal CardBalance { get; set; }  // 医疗卡余额
        public string CardStatus { get; set; }    // 医疗卡状态
    }

    /// <summary>
    /// 待收费处方DTO
    /// </summary>
    public class PendingPrescriptionDto
    {
        public int PrescriptionId { get; set; }
        public string PrescriptionNo { get; set; }
        public string Type { get; set; }
        public DateTime CreateTime { get; set; }
        public decimal Amount { get; set; }
        public List<PrescriptionItemDto> Items { get; set; } = new List<PrescriptionItemDto>();
    }

    /// <summary>
    /// 待收费检验单DTO
    /// </summary>
    public class PendingLaborderDto
    {
        public int LaborderId { get; set; }
        public string OrderNo { get; set; }
        public string ItemName { get; set; }
        public DateTime CreateTime { get; set; }
        public decimal Price { get; set; }
    }
} 